/* Copyright (c) 2011 Jordan Gray, MIT; see COPYRIGHT */


#ifndef LINT_H_
#define LINT_H_

#include <iosfwd>
#include <list>
#include <tr1/memory>

namespace ch11ex05 {

class LINT {
public:
  LINT();
  LINT(const LINT&);
  LINT(const std::list<unsigned char>&,bool);
  LINT(int);
  friend std::ostream& operator<<(std::ostream&, const LINT&);
  bool operator==(const LINT&) const;
  bool operator!=(const LINT&) const;
  LINT& operator=(LINT lint);
  LINT operator+(const LINT&) const;
  LINT& operator+=(const LINT&);
  LINT operator-(const LINT&) const;
  LINT& operator-=(const LINT&);
  LINT operator*(const LINT&) const;
  LINT& operator*=(const LINT&);
  LINT operator/(const LINT&) const;
  LINT& operator/=(const LINT&);
private:
  LINT& MakeUnique();
  LINT& ComputeArith(char, const LINT&);
  //LINT(ShPtr_LINTRep p_rep);
  class LINTRep;
  typedef std::tr1::shared_ptr<const LINTRep> ShPtrC_LINTRep;
  typedef std::tr1::shared_ptr<LINTRep> ShPtr_LINTRep;
  ShPtr_LINTRep p_rep_;
};

} // namespace ch11ex05

#endif /* LINT_H_ */
